
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">



<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<%@ include file="cabecalho.jsp" %>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>


</head>
<body>

<script language="javascript">
function excluiRegistro(id,sis)
{
    if (confirm("Deseja realmente excluir o registro?"))
    {
        document.frmExcluiRegistro.id.value=id;
        document.frmExcluiRegistro.submit();
    }
}
function alteraRegistro(id,sis)
{
    document.frmAlteraRegistro.id.value=id;
    document.frmAlteraRegistro.submit();
}

</script>



<br>
<br>
<div align="center">
		<div class="topocentro"><b>ITEM</b></div>
		<div align="left" class="centro">
		<table width="100%">
			<tr>
				<td align="right">
					<form action="/PapelariaProj/itemIncluir.jsp" method="post" >
						<input type="submit" name="enviar" value="Novo" />
					</form>
				</td>
			</tr>
		</table>
		<table width="100%">
			<tr>
				<td>
				
				<form action="ItemListar" method="post" >
					<table>
					<tr>
						<td>
							Descrição:
						</td>
						<td>
							 <input type="text" name="descricao" size="85"/><br>
						</td>
					 	<td>
					 	</td>
					 	<td>
					 		<input type="submit" name="enviar" value="Buscar" />
					 	</td>
					 </tr>
					</table>
				</form>
				
				</td>
			</tr>
			<tr>
				<td>
					<br>
				</td>
			</tr>
			<tr>
				<td colspan="3">
					<table width=100% class="mostra">
					
						<tr class="mostra"> 
							<th class="mostra">Cod. </th> 
							<th class="mostra">Descrição </th> 
							<th class="mostra">Marca </th>  
							<th class="mostra">Qte. Disponível </th>  
							<th class="mostra">Preço </th>
							<th class="mostra">Editar</th>
							<th class="mostra">Excluir</th>
						</tr>
						
						<c:forEach var="item" items="${itemLista}">
        					<tr class="mostra">
          						<td class="mostra">${item.codigo}</td>
          						<td class="mostra">${item.descricao}</td>
          						<td class="mostra">${item.marca}</td>
          						<td class="mostra">${item.qtdEstoque}</td>
          						<td class="mostra">${item.precoVenda}</td>
          						<td class="mostra">
          							 <a href="javascript:alteraRegistro(${item.codigo});">
          								<img border="0" src="imagens/editar.png" alt="Excluir registro">
          							</a>
          						</td>
          						<td class="mostra">
									<a href="javascript:excluiRegistro(${item.codigo});">
										<img border="0" src="imagens/deletar.png" alt="Excluir registro">
									</a>
          						</td>
        					</tr>
      					</c:forEach>
												
					</table>
				</td>
			</tr>
			
		</table>
		</div>
	</div>
	    
	    <form name="frmExcluiRegistro" method="POST" action="ItemExcluir">
            <input name="id" style="text-transform:uppercase;" type="hidden" size="1" value=""/>
            <input name="sistema" style="text-transform:uppercase;" type="hidden" size="1" value=""/>
        </form>
        
        <form name="frmAlteraRegistro" method="POST" action="ItemAlterar">
            <input name="id" style="text-transform:uppercase;" type="hidden" size="1" value=""/>
            <input name="sistema" style="text-transform:uppercase;" type="hidden" size="1" value=""/>
        </form>
	
</body>
</html>